#ifndef GMSSL_SM3_H
#define GMSSL_SM3_H
#include <stdint.h>

#define SM3_DIGEST_SIZE		32
#define SM3_BLOCK_SIZE		64


typedef struct {
    uint32_t state[8];
    uint64_t nb_locks;
    uint8_t block[SM3_BLOCK_SIZE];
    size_t num;
} SM3_CTX;

void sm3_init(SM3_CTX *ctx);

void sm3_update(SM3_CTX *ctx, const uint8_t *data, size_t data_len);

void sm3_finish(SM3_CTX *ctx, uint8_t digest[SM3_DIGEST_SIZE]);

#endif
